Create types to store serializable data about the ECS schedule and provide tools for extracting this data.#22520
Conversation
dc577da to
66cb075
Compare
|
This is currently a draft because there's a problem that edges coming from schedule build passes (e.g., auto_insert_apply_deferred) are not being extracted. |
66cb075 to
9d1f0d8
Compare
|
The generated |
db0c487 to
d186888
Compare
73396a4 to
df517e0
Compare
df517e0 to
e35a02d
Compare
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
…ing a default flag.
alice-i-cecile
left a comment
There was a problem hiding this comment.
LGTM now, but please do open an issue about testing all features :) Not a unique problem to this PR, and not one I want to forget about.
| pub fn initialize(&mut self, world: &mut World) -> Result<(), ScheduleBuildError> { | ||
| /// Moves all systems and run conditions out of the [`ScheduleGraph`]. If the schedule is built | ||
| /// successfully, returns [`Some`] with the metadata. If the schedule has previously been built | ||
| /// successfully, returns [`None`]. |
There was a problem hiding this comment.
iiuc, but also if this is potentially confusing to add or initialize is not used in this way, you can reject this suggestion:
| /// successfully, returns [`None`]. | |
| /// successfully and has not changed since previous init, returns [`None`]. |
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
|
This PR made the benchmarks |
…ta. (#23733) # Objective - A possible step towards #10981. - Followup to #22520. - We accidentally have two implementations of the same thing! We created a way to collect schedule data in `bevy_dev_tools` and in `bevy_remote`. `ScheduleData` is a more complete implementation of collecting schedule data, and is less tied to the internals of BRP (e.g., it supports serializing to disk instead of only through the BRP API), so we switch to that. ## Solution - Replace the implementation of `schedule.graph` with the `ScheduleData` API. A disadvantage is that we now need to wait for the schedules to be initialized before we can read them. Since users have to connect with BRP though, it is almost certain that the schedules will be initialized by the time they request the schedules. This may not be true of schedules like state transitions though - since these only run rarely. In a future PR, we can build the schedules on-demand instead. ## Testing - Updated the test for this. - Ran the same test as #23452 - Terminal 1: `cargo r --example server --features=bevy_remote` - Terminal 2: `curl -d'{"jsonrpc":"2.0","method":"schedule.graph","id":1,"params":{"schedule_label":"First"}}' -X POST -H "Accept: applcation/json" -H "Content-Type: application/json" http://127.0.0.1:15702` - It dumped out a whole load of JSON that looked expected! - I don't have a visualization of the schedule data yet, so I can't validate that it's correct, but there's no reason to believe its wrong given the existing `ScheduleData` tests.
…ta. (bevyengine#23733) # Objective - A possible step towards bevyengine#10981. - Followup to bevyengine#22520. - We accidentally have two implementations of the same thing! We created a way to collect schedule data in `bevy_dev_tools` and in `bevy_remote`. `ScheduleData` is a more complete implementation of collecting schedule data, and is less tied to the internals of BRP (e.g., it supports serializing to disk instead of only through the BRP API), so we switch to that. ## Solution - Replace the implementation of `schedule.graph` with the `ScheduleData` API. A disadvantage is that we now need to wait for the schedules to be initialized before we can read them. Since users have to connect with BRP though, it is almost certain that the schedules will be initialized by the time they request the schedules. This may not be true of schedules like state transitions though - since these only run rarely. In a future PR, we can build the schedules on-demand instead. ## Testing - Updated the test for this. - Ran the same test as bevyengine#23452 - Terminal 1: `cargo r --example server --features=bevy_remote` - Terminal 2: `curl -d'{"jsonrpc":"2.0","method":"schedule.graph","id":1,"params":{"schedule_label":"First"}}' -X POST -H "Accept: applcation/json" -H "Content-Type: application/json" http://127.0.0.1:15702` - It dumped out a whole load of JSON that looked expected! - I don't have a visualization of the schedule data yet, so I can't validate that it's correct, but there's no reason to believe its wrong given the existing `ScheduleData` tests.
Objective
Here are also some non-goals for this PR. These are left as future work:
Solution
Schedule.App.bevy_ecsreturn edges that build passes added.bevy_ecsreturn the "build metadata" to the caller, and also trigger as an event.Testing